<template>
  <div>
    <search-form
      :search-config="searchConfig"
      :label-width="150"
      @clear="clearSearch"
      @search="handleSearch"
    />
    <c-permission-tabs v-model="activeType" code="tab">
      <el-tab-pane label="全部" name="all" opt-code="all">
        <List :active-type="activeType" :serach-filters="serachFilters" type="all" />
      </el-tab-pane>
      <el-tab-pane label="待审核" name="curtainAudit" opt-code="curtainAudit">
        <List :active-type="activeType" :serach-filters="serachFilters" type="curtainAudit" />
      </el-tab-pane>
    </c-permission-tabs>
  </div>
</template>

<script>
import List from './components/List'
export default {
  name: 'CurtainManage',
  components: {
    List
  },
  data() {
    return {
      activeType: '',
      searchConfig: [

        // { label: '门店编码', prop: 'shopCode', type: 'text' },
        { label: '窗帘任务号', prop: 'colorTaskCode', type: 'text' },
        {
          type: 'select',
          prop: 'colorSchedule',
          label: '窗帘任务进度',
          value: '',
          placeholder: '窗帘任务进度',
          config: {
            remote: true,
            // paramField: 'keyWord', // 远程搜索参数名
            remoteUrl: `/data-dict/api/v2/dictionary/SWATCHES_PROGRESS`,
            defaultProps: {
              label: 'dictName',
              value: 'dictCode'
            },
            paramsRaw: { appCode: 'slm', domainCode: 'marketing' }
          }
        },
        { label: '门店建设项目号', prop: 'constCode', type: 'text' }

      ],
      serachFilters: []
    }
  },
  methods: {
    // confirmHandle(v) {
    //   console.log(this.formData, v)
    // },
    // resetHandle() {
    //   console.log('resetHandle')
    // }
    // 清空搜索条件
    clearSearch(data) {
      this.serachFilters = []
      console.log('清除搜索', data)
    },
    // 获取搜索条件
    handleSearch(data) {
      this.serachFilters = data.filtersRaw
    }
  }
}
</script>
